<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>材料订单1</title>
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
    <div id="parentTarget">
        <!-- 查询条件 -->
        <div class="demoTable">
            <label for="demoReload">搜索订单编号：</label>
            <div class="layui-inline">
                <input class="layui-input" name="orderId" id="demoReload" autocomplete="off">
            </div>
             <button class="layui-btn" data-type="reload">搜索</button>
        </div>
        <table id="demo" lay-filter="test"></table>
    </div>
</body>
<script !src="">
    //引入外置layui组件
    layui.config({
        base: '/js/modules/' //外置组件路径
    }).use(['layer', 'table', 'form', 'laydate', 'laytpl', 'tableEdit'],function () {
        //声明对象
        let layer = layui.layer
            , table = layui.table
            , form = layui.form
            , laydate = layui.laydate
            , laytpl = layui.laytpl
            , tableEdit = layui.tableEdit
            , $ = layui.$;

        /** 声明数据对象 **/
        let customerList; //供应商信息列表
        let goodsList; //材料信息列表
        let dataParams = new Array(); //物品信息下拉框数值
        let loginStaff; //登录员工信息下拉框数值
        /* 获取声明对象数据 */
        updateSelfData();
        /** 获取声明对象数据 **/
        // alert(JSON.stringify(customerList))
        function updateSelfData() {
            //关闭异步
            $.ajaxSettings.async = false;
            //供应商信息列表
            $.post('/su/queryAll',{},function (result) {
                customerList = result.data.items;
            });
            //物品信息列表
            $.post('/g/query/materials',{},function (result) {
                goodsList = result.data.items;
            });
            //登录员工信息
            $.post('/s/loginStaff',{},function (res){
                    loginStaff = res.data;
            });
            //开启异步
            $.ajaxSettings.async = true;
            //生成dataParams数组
            for (let i = 0; i < goodsList.length; i++) {
                dataParams.push({name: goodsList[i].goodsId, value: goodsList[i].name});
            }
            // alert(JSON.stringify(dataParams))
        }

        /*---------------数据表操作--------------------*/
        let mainTable = table.render({
            elem: '#demo' //table容器
            ,height : 550
            ,width : 1310
            ,url: '/o/query/procurement' //数据接口
            ,page: true //开启分页
            ,toolbar: true //开启工具栏
            ,defaultToolbar: [{ //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '添加'
                ,layEvent: 'add'
                ,icon: 'layui-icon-add-1'
            },{ //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '上传数据'
                ,layEvent: 'upload'
                ,icon: 'layui-icon-upload'
            },'filter', 'exports', 'print']
            ,cols: [[
                {fixed: 'left', type: 'checkbox', width: 50}
                ,{type: 'numbers', title: '序号', width: 80}
                ,{field: 'orderId', title: '订单编号', minWidth: 80, sort: true}
                ,{field: 'companyId', title: '供应商编号', minWidth: 80, sort: true, templet: formatCustomerName}
                ,{field: 'totalPrice', title: '订单总额', minWidth: 80, templet: formatNumber}
                ,{field: 'createDate', title: '创建时间', minWidth: 80, sort: true}
                ,{field: 'deliveryDate', title: '交货日期', minWidth: 80, sort: true}
                ,{field: 'status', title: '订单状态', width: 100 , templet: formatOrderStatus}
                ,{fixed: 'right', title: '操作', width: 150, toolbar: '#barDemo'}
            ]]
            ,parseData: function (res) {//自定义数据格式
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": res.data.count, //解析数据长度
                    "data": res.data.items //解析数据列表
                };
            }
            ,request: {//自定义分页参数名称
                pageName: 'currPage' //页码的参数名称，默认：page
                ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
            }
            ,text: {//自定义提示文本内容
                none: '未找到符合条件的数据!'
            }
            ,id: 'testReload' //table的识别id
        });

        /** 监听单元格事件 **/
        table.on('tool(test)',function (object) {
            switch (object.event) {
                case 'detail':
                    // layer.msg('查看详情');
                    $.post('/o/query/procurement',{'id':object.data.id},function (result) {
                        queryDetail(result.data.items[0]);
                    });
                    break;
                case 'edit':
                    // layer.msg('编辑');
                    $.post('/o/query/procurement',{'id':object.data.id},function (result) {
                        editInfo(result.data.items[0]);
                    });
                    break;
                case 'add':
                    layer.msg('添加');
                    break;
            }
        });
        /** 监听工具栏事件 **/
        table.on('toolbar(test)',function (object) {
            if (object.event == 'add'){
                // layer.msg('添加');
                addInfo();
            }
        })
        /** 绑定搜索按钮触发事件 **/
        $('.demoTable .layui-btn').on('click', function () {
            //重载表格数据
            mainTable.reload({
                //访问后台带的参数
                where: {
                    orderId: $('#demoReload').val()
                }
            })
        });
        /*---------------弹窗控制--------------------*/
        /** 查看详情 **/
        function queryDetail(data) {
            //弹窗渲染
            layer.open({
                type: 1 //弹窗类型
                ,area: ['1000px','600px'] //弹窗大小
                ,title: '采购订单详情' //弹窗标题
                ,content: $('#detailPage').html() //弹窗内容
            })
            /* 填充表单数据 */
            //填充表单数据
            dataInit(data);
            //填充表格数据
            table.render({
                elem: '.formTable'
                ,cols: [[ //表头
                    {field: 'goodsId', title: '物品名称', minWidth: 80, templet:showGoodsId}
                    ,{field: 'quantity', title: '数量', minWidth: 80}
                    ,{field: 'unit', title: '计量单位', minWidth: 80}
                    ,{field: 'goodsInfo', title: '规格信息', minWidth: 80}
                ]]
                ,data: data.orderDetailVos
                ,id: 'formTable'
                ,text: {//自定义提示文本内容
                    none: '未找到符合条件的数据!'
                }
            });
        }
        /** 修改信息 **/
        function editInfo(data) {
            //弹窗渲染
            let index = layer.open({
                type: 1 //弹窗类型
                ,area: ['1000px','600px'] //弹窗大小
                ,title: '编辑采购订单' //弹窗标题
                ,content: $('#editPage').html() //弹窗内容
            });
            /* 填充表单数据 */
            dataInit(data);
            /* 渲染弹窗中的表格 */
            let formTable = table.render({
                elem: '.formTable'
                ,cols: [[ //表头
                    {field: 'goodsId', title: '物品名称', minWidth: 80, event: 'goodsId'
                        , config: {type: 'select', data: dataParams, verify: true}, templet:showGoodsId
                    }
                    ,{field: 'quantity', title: '数量', minWidth: 80, event: 'quantity'
                        , config: {type: 'input', verify: {type:'number'}}}
                    ,{field: 'unit', title: '计量单位', minWidth: 80, event: 'unit'
                        , config: {type: 'input'
                            , verify: {"regx":/^[\u4e00-\u9fa5]+$/,msg:"请填入中文计量单位"}}}
                    ,{field: 'goodsInfo', title: '规格信息', minWidth: 80}
                    ,{fixed: 'right', width: 80, toolbar: '#remove'}
                ]]
                ,data: data.orderDetailVos
                ,id: 'formTable'
                ,text: {//自定义提示文本内容
                    none: '未找到符合条件的数据!'
                }
            });

            /** 绑定按钮事件 **/
            /* 保存按钮 */
            form.on('submit(formDemo)', function(data){
                let val = form.val('example'), data1 = table.getData('formTable');
                //向后台发送数据
                $.post('/o/modify', {"order":JSON.stringify(val),"obj":JSON.stringify(data1)},function (res) {
                    layer.alert(res.msg);
                    if (res.success == 'true') layer.close(index);
                });
                table.reload('testReload');
                return false; //阻止表单跳转
            });
            /* 重置按钮 */
            form.on('submit(reset)', function(){
                //初始化数据
                dataInit(data);
                //重载表格
                table.reload('formTable',{
                    data: data.orderDetailVos
                });
                return false; //阻止表单跳转
            });
            /* 监听数据表中单元格事件 */
            tableFromEvent(formTable);
        }
        /** 新增信息 **/
        function addInfo() {
            //弹窗渲染
            let index = layer.open({
                type: 1 //弹窗类型
                ,area: ['1000px','600px'] //弹窗大小
                ,title: '创建采购订单' //弹窗标题
                ,content: $('#addPage').html() //弹窗内容
            });
            /* 填充表单数据 */
            //填充下拉选现
            printOption(customerList);
            //填充数据
            form.val('example',{
                'status': 2
                ,'payStatus': 1
                ,'creator': loginStaff.id
            });
            /* 渲染弹窗中的表格 */
            let formTable = table.render({
                elem: '.formTable'
                ,cols: [[ //表头
                    {field: 'goodsId', title: '物品名称', minWidth: 80, event: 'goodsId'
                        , config: {type: 'select', data: dataParams, verify: true}, templet:showGoodsId
                    }
                    ,{field: 'quantity', title: '数量', minWidth: 80, event: 'quantity'
                        , config: {type: 'input', verify: {type:'number'}}}
                    ,{field: 'unit', title: '计量单位', minWidth: 80, event: 'unit'
                        , config: {type: 'input'
                            , verify: {"regx":/^[\u4e00-\u9fa5]+$/,msg:"请填入中文计量单位"}}}
                    ,{field: 'goodsInfo', title: '规格信息', minWidth: 80}
                    ,{fixed: 'right', width: 80, toolbar: '#remove'}
                ]]
                ,data: [{'goodsId':'','quantity':'','unit':'','goodsInfo':''}]
                ,id: 'formTable'
            });
            /** 开启日期选择器 **/
            laydate.render({
                elem: '.dateUtil'
                ,type: 'date'
            });
            /** 绑定按钮事件 **/
            /* 保存按钮 */
            form.on('submit(formDemo)', function(data){
                let val = form.val('example'), data1 = table.getData('formTable');
                //向后台发送数据
                $.post('/o/add', {"order":JSON.stringify(val),"obj":JSON.stringify(data1)},function (res) {
                    layer.alert(res.msg);
                    if (res.success == 'true') layer.close(index);
                });
                table.reload('testReload');
                return false; //阻止表单跳转
            });
            /* 重置按钮 */
            form.on('submit(reset)', function(){
                form.reset();
                return false; //阻止表单跳转
            });
            /* 监听数据表中单元格事件 */
            tableFromEvent(formTable);
        }


        /*---------------自定义函数--------------------*/
        /** 自定义表单验证 **/
        form.verify({
            unit: [
                /^[\u4e00-\u9fa5]+$/
                ,'请填入中文单位'
            ]
        });
        /** 生成下拉选项内容 **/
        function printOption(dataList) {
            //生成选项
            for (let i = 0; i < dataList.length; i++) {
                let $option = $("<option value='" + dataList[i].supplierId + "'>" + dataList[i].supplierName + "</option>");
                $(".form-table-select").append($option);
            }
            //渲染下拉框
            form.render('select');
        }
        /** 监听数据表中表单事件 **/
        function tableFromEvent(obj) {
            //获取一个aop对象
            let aopTable = tableEdit.aopObj(obj.config.cols);
            //监听单元格事件
            aopTable.on('tool(test1)',function (obj) {
                var field = obj.field; //单元格字段
                var value = obj.value; //修改后的值
                var data = obj.data; //当前行旧数据
                var event = obj.event; //当前单元格事件属性值
                var update = {};
                //把value更新到行中
                if (event == 'goodsId'){
                    update[field] = value.name;
                } else {
                    update[field] = value;
                }
                obj.update(update);

                /* 事件匹配 */
                /** 增删表格数据行 **/
                if(obj.event === 'del'){
                    //删除对应行（tr）的DOM结构，并更新缓存
                    obj.del();
                } else if (obj.event === 'add'){
                    /* 添加空行 */
                    //获取表格数据
                    let oldData = table.getData('formTable');
                    let data2 = {'goodsId':'','quantity':'','unit':'','goodsInfo':''};
                    //增加空行
                    oldData.push(data2);
                    //重载表格
                    table.reload('formTable',{
                        data:oldData
                    });
                }

            });
        }
        /** 物品下拉框对应表格显示 **/
        function showGoodsId(d) {
            // alert(JSON.stringify(dataParams));
            for (let i = 0; i < dataParams.length; i++) {
                if (dataParams[i].name == d.goodsId){
                    return dataParams[i].value;
                }
            }
            // alert(JSON.stringify(dataParams))
            return '-请选择-';
        }
        /** 表单数据初始化 **/
        function dataInit(data) {
            /* 填充表单数据 */
            //填充表单数据
            form.val('example',{//lay-filter中的值指定填充表单
                'id': data.id
                ,'orderId': data.orderId
                ,'totalPrice': data.totalPrice
                ,'createDate': data.createDate
                ,'deliveryDate': data.deliveryDate
                ,'companyId': data.companyId
                ,'chargePersonId': data.chargePersonId
                ,'status': data.status
                ,'sendDate': data.sendDate
                ,'settlementDate': data.settlementDate
                ,'payStatus': data.payStatus
                ,'creator': data.creator
            });
            //开启日期选择器
            laydate.render({
                elem: '.dateUtil'
                ,type: 'date'
            });
        }
        /** 数值格式化：保留两位小数 **/
        function formatNumber(d) {
            return d.totalPrice.toFixed(2);
        }
        /** 客户名称格式化 **/
        function formatCustomerName(d) {
            for (let i = 0; i < customerList.length; i++) {
                if (d.companyId == customerList[i].supplierId) return customerList[i].supplierId
            }
            return d.companyId;
        }
        /** 订单状态格式化 **/
        function formatOrderStatus(d) {
            switch (d.status) {
                case 1:
                    return '废弃';
                case 2:
                    return '创建';
                case 3:
                    return '审核中';
                case 4:
                    return '备货中';
                case 5:
                    return '在途';
                case 6:
                    return '已签收';
            }
        }
    })

</script>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs"
       {{# if(d.status != 6){ }}
       lay-event="edit"
       {{#  } else { }}
       style="background-color: darkgrey;"
       {{# } }}
    >编辑</a>
</script>
<script type="text/html" id="remove">
    <i class="layui-icon layui-icon-add-circle-fine" lay-event="add" style="font-size: 20px"></i>
    <i class="layui-icon layui-icon-reduce-circle" lay-event="del" style="font-size: 20px"></i>
</script>
<script type="text/html" id="detailPage">
    <form class="layui-form" lay-filter="example">
        <div class="layui-form-item" hidden>
            <label class="layui-form-label">编号</label>
            <div class="layui-input-inline">
                <input type="text" name="id" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单编号</label>
            <div class="layui-input-inline">
                <input type="text" name="orderId" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单总额</label>
            <div class="layui-input-inline">
                <input type="text" name="totalPrice" required lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">创建时间</label>
            <div class="layui-input-inline">
                <input type="text" name="createDate" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">交货日期</label>
            <div class="layui-input-inline">
                <input type="text" name="deliveryDate" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">公司编号</label>
            <div class="layui-input-inline">
                <input type="text" name="companyId" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">责任人工号</label>
            <div class="layui-input-inline">
                <input type="text" name="chargePersonId" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单状态</label>
            <div class="layui-input-inline">
                <select name="status" class="layui-input" disabled required autocomplete="off">
                    <option value="0">删除</option>
                    <option value="1">废弃</option>
                    <option value="2">创建</option>
                    <option value="3">审核中</option>
                    <option value="4">备货中</option>
                    <option value="5">在途</option>
                    <option value="6">已签收</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发货日期</label>
            <div class="layui-input-inline">
                <input type="text" name="sendDate" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">结算时间</label>
            <div class="layui-input-inline">
                <input type="text" name="settlementDate" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">支付状态</label>
            <div class="layui-input-inline">
                <select name="payStatus" class="layui-input" disabled required lay-verify="required" autocomplete="off">
                    <option value="0">部分预付</option>
                    <option value="1">未付款</option>
                    <option value="2">已结清</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单创建人</label>
            <div class="layui-input-inline">
                <input type="text" name="creator" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <table class="formTable" lay-filter="test"></table>
    </form>
</script>
<script type="text/html" id="editPage">
    <form class="layui-form" lay-filter="example">
        <div class="layui-form-item" hidden>
            <label class="layui-form-label">编号</label>
            <div class="layui-input-inline">
                <input type="text" name="id" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单编号</label>
            <div class="layui-input-inline">
                <input type="text" name="orderId" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" hidden>
            <label class="layui-form-label">订单类型</label>
            <div class="layui-input-inline">
                <input type="text" name="orderType" value="2" readonly  lay-verify="orderType" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单总额</label>
            <div class="layui-input-inline">
                <input type="text" name="totalPrice" placeholder="请输入数值，例：1000.00" lay-verify="number|required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">创建时间</label>
            <div class="layui-input-inline">
                <input type="text" name="createDate" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">交货日期</label>
            <div class="layui-input-inline">
                <input type="text" name="deliveryDate" required  lay-verify="required" readonly  autocomplete="off" class="layui-input dateUtil">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">公司编号</label>
            <div class="layui-input-inline">
                <input type="text" name="companyId" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">责任人工号</label>
            <div class="layui-input-inline">
                <input type="text" name="chargePersonId" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单状态</label>
            <div class="layui-input-inline">
                <select name="status" class="layui-input"  required autocomplete="off">
                    <option value="0">删除</option>
                    <option value="1">废弃</option>
                    <option value="2">创建</option>
                    <option value="3">审核中</option>
                    <option value="4">备货中</option>
                    <option value="5">在途</option>
                    <option value="6">已签收</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发货日期</label>
            <div class="layui-input-inline">
                <input type="text" name="sendDate" required  lay-verify="" readonly autocomplete="off" class="layui-input dateUtil">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">结算时间</label>
            <div class="layui-input-inline">
                <input type="text" name="settlementDate" required  lay-verify="" readonly autocomplete="off" class="layui-input dateUtil">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">支付状态</label>
            <div class="layui-input-inline">
                <select name="payStatus" class="layui-input" required lay-verify="required" autocomplete="off">
                    <option value="0">部分预付</option>
                    <option value="1">未付款</option>
                    <option value="2">已结清</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单创建人</label>
            <div class="layui-input-inline">
                <input type="text" name="creator" required  lay-verify="required" readonly autocomplete="off" class="layui-input">
            </div>
        </div>
        <table class="formTable" lay-filter="test1"></table>
        <div class="layui-form-item btn">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset">重置</button>
            </div>
        </div>
    </form>
</script>
<script type="text/html" id="addPage">
    <form class="layui-form" lay-filter="example">
        <div class="layui-form-item" hidden>
            <label class="layui-form-label">订单编号</label>
            <div class="layui-input-inline">
                <input type="text" name="orderId"  lay-verify="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" hidden>
            <label class="layui-form-label">订单类型</label>
            <div class="layui-input-inline">
                <input type="text" name="orderType" value="2" readonly  lay-verify="orderType" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单总额</label>
            <div class="layui-input-inline">
                <input type="text" name="totalPrice"  placeholder="请输入数值，例：1000.00" lay-verify="number|required"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">交货日期</label>
            <div class="layui-input-inline">
                <input type="text" name="deliveryDate" required readonly lay-verify="required" placeholder="必填" autocomplete="off" class="layui-input dateUtil">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">公司编号</label>
            <div class="layui-input-inline">
                <select name="companyId" class="layui-input form-table-select" placeholder="必填" lay-verify="required" required autocomplete="off">
                    <option value="">-请选择-</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">责任人工号</label>
            <div class="layui-input-inline">
                <input type="text" name="chargePersonId" required  lay-verify="required|number" placeholder="请输入负责人工号"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单状态</label>
            <div class="layui-input-inline">
                <select name="status" class="layui-input"  required autocomplete="off" disabled>
                    <option value="0">删除</option>
                    <option value="1">废弃</option>
                    <option value="2">创建</option>
                    <option value="3">审核中</option>
                    <option value="4">备货中</option>
                    <option value="5">在途</option>
                    <option value="6">已签收</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发货日期</label>
            <div class="layui-input-inline">
                <input type="text" name="sendDate" readonly  lay-verify=""  autocomplete="off" class="layui-input dateUtil">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">结算时间</label>
            <div class="layui-input-inline">
                <input type="text" name="settlementDate" readonly  lay-verify=""  autocomplete="off" class="layui-input dateUtil">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">支付状态</label>
            <div class="layui-input-inline">
                <select name="payStatus" class="layui-input" required lay-verify="required" autocomplete="off">
                    <option value="0">部分预付</option>
                    <option value="1">未付款</option>
                    <option value="2">已结清</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单创建人</label>
            <div class="layui-input-inline">
                <input type="text" name="creator" required placeholder="请输入员工工号" lay-verify="required"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <table class="formTable" lay-filter="test1"></table>
        <div class="layui-form-item btn">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset">重置</button>
            </div>
        </div>
    </form>
</script>
</html>